class DragEl extends Drag {
  constructor(...arg) {
    super(...arg);
    this.startOffset = {};
    this.on("dragstart", (e) => {
      this.dragStart(e);
    });
    this.on("dragmove", (e, dis, now) => {
      this.dragMove(e, dis, now);
    });
  }
  dragStart(e) {
    this.startOffset = {
      x: parseFloat(getComputedStyle(this.el)["left"]),
      y: parseFloat(getComputedStyle(this.el)["top"]),
    };
    e.stopPropagation(); // 处理冒泡
  }
  dragMove(e, dis, now) {
    let nowOffset = {
      x: this.startOffset.x + dis.x,
      y: this.startOffset.y + dis.y,
    };
    this.el.style.left = nowOffset.x + "px";
    this.el.style.top = nowOffset.y + "px";
  }
}